<?php

# mvblogs_2-0
# 2006 Oct 06  08:15:23
# audit function

function audit($message, $type = 'notice', $object = 'fe: default', $kbId = '0')
{
    $userId = getSessionUser()->getUserId();
    $mysqli = getDBConnection();
    $result = $mysqli->query(
        "INSERT INTO audit_trail (user_id, date_time, object, message, kb_id, "
      . "type) VALUES ('{$userId}', '{$dateTime}', '{$object}', '{$message}', "
      . "'{$kbId}', '{$type}')");
    if ($result) return true;
    return $mysqli->error;
}